package net.yxsoft.websocket.command;

import com.alibaba.fastjson.JSONObject;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.group.ChannelGroup;
import rapid.netty.command.JsonCommand;
import rapid.netty.command.RespCommand;
import rapid.util.StrKit;

public class _TemplateCmd extends JsonCommand {

  @Override
  public void execute(ChannelGroup group, ChannelHandlerContext ctx, JSONObject json) {

    String userId = json.getString("userId");

    // 检查参数是否完整
    if(StrKit.isEmpty(userId)) {
      response(ctx, new RespCommand("ERROR", "参数丢失！。").toJsonString());
      return;
    }

    System.out.println("微信前台:" + ctx.channel().id());
  }

}
